home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 3943.ZIP / EVOLV201.ZIP / DPMIUSER.DOC < prev    next >
Text File  |  1993-07-02  |  10KB  |  244 lines

  1.                      DPMI USER DOCUMENTATION
  2.                  Borland Pascal With Objects 7.0
  3.  
  4. This file documents the use of RTM.EXE, RTMRES.EXE, DPMI16BI.OVL,
  5. DPMIINST.EXE and DPMILOAD.EXE is intended for redistribution
  6. under the terms of the license statement accompanying this
  7. product. 
  8.  
  9. Included is documentation about these topics:
  10.  
  11.   o Running a DOS Protected-Mode Program
  12.  
  13.   o What to do if Borland's DPMI server does not run on your
  14.     system
  15.  
  16.   o How to set DOS environment variables that affect all
  17.     protected-mode programs generated by Borland Pascal with
  18.     Objects 7.0
  19.  
  20.   o Special notes for running under Windows
  21.  
  22.   o Controlling the amount of memory the run-time manager uses
  23.  
  24.   o Special note for Borland C++ and Paradox 4.0 users
  25.  
  26. ================================================================
  27. Running a DOS Protected-Mode Program
  28. ================================================================
  29.  
  30. When you run a DOS protected-mode application, you must ensure
  31. that DPMI16BI.OVL (the DPMI server), RTM.EXE (the run-time
  32. manager), and any DLLs used by the application are present in the
  33. current directory, the same directory as the application, or on
  34. the DOS path.
  35.  
  36.  
  37. Protected Mode and Memory
  38. -------------------------
  39.  
  40. A DOS protected-mode program uses DPMI (DOS Protected Mode
  41. Interface) to run in protected mode which gives the application
  42. access to all your computer's memory. With the exceptions
  43. outlined below, the DOS protected-mode technology is completely
  44. transparent and no extra steps are necessary in order to run a
  45. protected-mode application.
  46.  
  47.  
  48. DPMIINST
  49.  
  50. One such exception might be when you run a protected-mode program
  51. for the very first time on a 286-based system. The protected mode
  52. technology uses an internal database which contains various
  53. machine characteristics to determine how to enable protected mode
  54. operation on your system, and configures itself accordingly. If
  55. you have a computer with an older 80286 microprocessor, your
  56. system might not be recognized. You'll see this message when you
  57. try to run a protected-mode application:
  58.  
  59.   Machine not in database (RUN DPMIINST)
  60.  
  61. If you get this message, simply run the DPMIINST program by
  62. typing DPMIINST at the DOS prompt and following the program's
  63. instructions.
  64.  
  65. DPMIINST runs your machine through a series of tests to determine
  66. the best way of enabling protected mode, and automatically
  67. configures accordingly. Once you have run DPMIINST, you won't
  68. have to run it again.
  69.  
  70. Some memory managers, device drivers, and memory-resident (TSR)
  71. programs can interfere with DPMIINST's ability to analyze your
  72. system. If DPMIINST fails, try temporarily disabling or removing
  73. these programs. That gives DPMIINST the unrestricted access it
  74. needs to determine the best way to enter protected mode.
  75.  
  76. Note that running DPMIINST.EXE will never be required on any
  77. system running HIMEM (or equivalent) or on any system based on
  78. an 80386 (or later) processor.
  79.  
  80.  
  81. DPMIMEM
  82.  
  83. By default, the DPMI interface allocates all available extended
  84. memory for its own use. If you don't want all of the available
  85. memory to be taken by the DPMI kernel, you can set a DOS
  86. environment variable to specify the maximum amount of memory to
  87. use. This variable can be entered directly at the DOS prompt or
  88. inserted in your AUTOEXEC.BAT file, using this syntax:
  89.  
  90.   SET DPMIMEM=MAXMEM nnnn
  91.  
  92. where nnnn is the amount of memory in kilobytes.
  93.  
  94. For example, if you have a system with 4MB and want the DPMI
  95. kernel to use only 2MB of it, leaving the other 2MB alone, the
  96. DPMIMEM variable would be set as follows:
  97.  
  98.   SET DPMIMEM=MAXMEM 2048
  99.  
  100. Some memory managers, like QEMM or 386^Max, allow allocating the
  101. same area of memory as either extended or expanded and many older
  102. applications can use only expanded memmory (EMS). By using the
  103. DPMIMEM DOS environment variable to limit the amount of extended
  104. memory used by the DPMI server, your system will still have
  105. expanded memory available for use by older applications.
  106.  
  107.  
  108. RTMRES
  109.  
  110. RTMRES preloads the protected-mode system. Preloading the DPMI
  111. server lets you load a protected-mode program slightly faster.
  112. RTMRES will start a program if you specify a program name as a
  113. parameter. If no parameter is specified, RTMRES will run a DOS
  114. shell. Type EXIT to close the shell.
  115.  
  116. RTMRES is especially useful if you start, exit, and start a
  117. protected-mode program frequently. Normally, every time you run a
  118. protected-mode application, the DPMI server is loaded. If you've
  119. run RTMRES previously, the server is already present, and the
  120. protected-mode application loads faster.
  121.  
  122.  
  123. EXTENDED MEMORY
  124.  
  125. A protected-mode application interacts with the DPMI server
  126. through Borland's run-time manager (RTM.EXE). By default, a
  127. protected-mode application uses all the extended memory reserved
  128. by the DPMI kernel.
  129.  
  130.  
  131. ================================================================
  132. Running A DOS Protected-Mode Program from Windows
  133. ================================================================
  134.  
  135. A DOS protected-mode program will run in Windows in 386 enhanced
  136. mode. To configure the amount of memory available to the
  137. application, create a Windows PIF file. To learn more about PIF
  138. files, see your Microsoft Windows User's Guide.
  139.  
  140.  
  141. Running Your Program in Windows Standard Mode
  142. ---------------------------------------------
  143.  
  144. In order to run a protected-mode program from Windows
  145. standard-mode, you must set the DPMIMEM DOS environment variable
  146. and run RTMRES (both are described above) before running Windows.
  147. Make sure your DPMIMEM setting leaves enough physical memory for
  148. Windows to operate.
  149.  
  150. Note that once you've run RTMRES, you won't be able to run
  151. Windows in 386 enhanced mode until you exit the RTMRES shell (by
  152. typing EXIT at a DOS prompt).
  153.  
  154.  
  155. Running from a Windows DOS Prompt
  156. ---------------------------------
  157.  
  158. To run a DOS protected-mode application from a Windows DOS
  159. prompt, you must first modify the DOSPRMPT.PIF file found in your
  160. Windows directory so that the protected-mode program will be able
  161. to use extended memory.
  162.  
  163. Using the Windows PIF editor, open the DOSPRMPT.PIF file, and
  164. indicate the amount of extended memory you want the
  165. protected-mode program to use. If you are unsure how to use the
  166. PIF editor, see your Microsoft Windows User's Guide.
  167.  
  168.  
  169. ================================================================
  170. Controlling the Amount of Memory the Run-Time Manager Uses
  171. ================================================================
  172.  
  173. The run-time manager attempts to free as much conventional memory
  174. as possible (by moving moveable memory blocks into extended
  175. memory, for example) before starting an application. No attempt
  176. is made to release extended memory, however. Therefore, if you
  177. are going to run other protected-mode applications that don't use
  178. the run-time manager (Paradox 4.0, for example), use the RTM DOS
  179. environment variable to control the run-time manager's allocation
  180. of memory.
  181.  
  182. Use the DOS command line to add the RTM environment variable to
  183. your system's DOS environment. Here is the syntax:
  184.  
  185.   SET RTM=[option nnnn]
  186.  
  187. The following table lists the options you can use. nnnn can be a
  188. decimal number or a hex number in the form of xAB54 or xab54.
  189.  
  190.    Option          Description
  191.    -------------------------------------------------------------
  192.    EXTLEAVE nnnn   Always leave at least nnnn kilobytes of
  193.                    extended memory available. The default value
  194.                    is 640K.
  195.  
  196.    EXTMAX nnnn     Don't allocate more than nnnn kilobytes of
  197.                    extended memory. The default value is 4
  198.                    gigabytes. In Windows, the default value is
  199.                    one-half the available memory.
  200.  
  201.    EXTMIN nnnn     If fewer than nnnn kilobytes are available
  202.                    after applying EXTMAX and EXTLEAVE limits,
  203.                    terminate with an Out of Memory message. The
  204.                    default value is zero.
  205.  
  206.    REALLEAVE nnnn  Always leave at least nnnn paragraphs of real
  207.                    memory available. The default value is 64K or
  208.                    4096 paragraphs.
  209.  
  210.    REALMAX nnnn    Don't allocate more than nnnn paragraphs of
  211.                    real memory. The default value is 1 megabyte
  212.                    or 65,535 paragraphs.
  213.  
  214.    REALMIN nnnn   If fewer than nnnn paragraphs are available
  215.                   after applying REALMAX and REALLEAVE, terminate
  216.                   with an Out of Memory message. The default
  217.                   value is zero.
  218.  
  219. The following DOS command limits RTM to 2M bytes of extended
  220. memory, and ensures that 128K bytes of real memory are left
  221. unallocated:
  222.  
  223.   SET RTM=EXTMAX 2048 REALLEAVE 8192
  224.  
  225.  
  226. ================================================================
  227. Important Note for Borland C++ and Paradox 4.0 Users
  228. ================================================================
  229.  
  230. The DPMILOAD.EXE and DPMI16BI.OVL files provided in this package
  231. replace the older ones that came with Paradox 4.0 and BC++ 3.0 or
  232. later. Delete or rename the older versions and make sure the
  233. newer ones are on your DOS path (both Paradox and BC will search
  234. the path and find the newer versions).
  235.  
  236. If you plan to shell out from Paradox or BC++ to run another
  237. protected-mode application, first limit the amount of extended
  238. memory used by Paradox or BC++. For Paradox, use its /extk
  239. command-line parameter; and for BC++, use its /x command-line
  240. parameter. Refer to the Paradox or BC++ documentation for more
  241. information on the use of command-line options.
  242.  
  243.                       *    *    *    *    *
  244.